
#ifndef MEDIACONFIG_H
#define MEDIACONFIG_H

#include <QObject>
#include <QStringList>
class QSettings;

class Config : public QObject
{
    Q_OBJECT
public:
    static Config *instance();
    ~Config();

    typedef enum{
        // should keep the same order as Config::lanList()
        LAN_EN,
        LAN_CN,
        LAN_COUNT
    }lanType;

    static const QStringList lanList();

    typedef enum{
        SYS_LANGUAGE = 0,
        CONFIG_COUNT
    }configItem;

    int getIntValue(configItem);
    QString getStringValue(configItem);
    void setIntValue(configItem, int);
    void setStringValue(configItem, QString &);
signals:
    void signalSettingsReseted();
private:
    explicit Config(const QString &file, QObject *parent = 0);
    QString getKeyString(configItem);
    QVariant readValue(configItem);
    QString m_configFile;
    QSettings *m_settings;
    static Config *s_pConfig;
    static QStringList s_lanList;

};

#endif // MEDIACONFIG_H
